package ktarou.m1k4.icu.util;

public enum Category {
	SOFTWARE("1", "Software"), GAME("2", "Game"), FUNNY("9", "Lucu-lucu"), SPORT("39",
			"Olah Raga"), OTHER("41", "Lain-lain"), VIDEO_CLIP("43", "Music/Video"), MOVIE(
			"45", "Film"), PHOTO("46", "Gambar/Foto"), MP3("48", "MP3"), ANIMATION(
			"49", "Animasi"), DRAMA("50", "TV Episode"), DOCUMENTER("52",
			"Dokumenter"), TRAILER("52", "Movie Trailer"), VIDEO_BLOG("53",
			"Video Blog"), ART("54", "Art/Wallpaper"), HOROR("55", "Horor/Aneh"), EBOOK(
			"56", "e-Book"), MANGA("57", "Manga");
	private String code;
	private String title;

	private Category(String code, String title) {
		this.code = code;
		this.title = title;
	}

	public String getCode() {
		return code;
	}

	public void setCode(String code) {
		this.code = code;
	}

	public String getTitle() {
		return title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	public String toString() {
		return getTitle();
	}

	public static String[] getValues() {
		String[] result = { SOFTWARE.toString(), GAME.toString(),
				FUNNY.toString(), SPORT.toString(), OTHER.toString(),
				VIDEO_CLIP.toString(), MOVIE.toString(), PHOTO.toString(),
				MP3.toString(), ANIMATION.toString(), DRAMA.toString(),
				DOCUMENTER.toString(), TRAILER.toString(),
				VIDEO_BLOG.toString(), ART.toString(), HOROR.toString(),
				EBOOK.toString(), MANGA.toString() };
		return result;
	}

	public static Category stringToCategory(String key) {
		Category cat = null;
		if (key.equals(SOFTWARE.getTitle())) {
			cat = SOFTWARE;
		}
		if (key.equals(GAME.getTitle())) {
			cat = GAME;
		}
		if (key.equals(FUNNY.getTitle())) {
			cat = FUNNY;
		}
		if (key.equals(SPORT.getTitle())) {
			cat = SPORT;
		}
		if (key.equals(OTHER.getTitle())) {
			cat = OTHER;
		}
		if (key.equals(VIDEO_CLIP.getTitle())) {
			cat = VIDEO_CLIP;
		}
		if (key.equals(MOVIE.getTitle())) {
			cat = MOVIE;
		}
		if (key.equals(PHOTO.getTitle())) {
			cat = PHOTO;
		}
		if (key.equals(MP3.getTitle())) {
			cat = MP3;
		}
		if (key.equals(ANIMATION.getTitle())) {
			cat = ANIMATION;
		}
		if (key.equals(DRAMA.getTitle())) {
			cat = DRAMA;
		}
		if (key.equals(DOCUMENTER.getTitle())) {
			cat = DOCUMENTER;
		}
		if (key.equals(TRAILER.getTitle())) {
			cat = TRAILER;
		}
		if (key.equals(VIDEO_BLOG.getTitle())) {
			cat = VIDEO_BLOG;
		}
		if (key.equals(ART.getTitle())) {
			cat = ART;
		}
		if (key.equals(HOROR.getTitle())) {
			cat = HOROR;
		}
		if (key.equals(EBOOK.getTitle())) {
			cat = EBOOK;
		}
		if (key.equals(MANGA.getTitle())) {
			cat = MANGA;
		}
		return cat;
	}
}
